﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.Security;

namespace HQWeb.Login
{
    public partial class Login : System.Web.UI.Page
    {
        protected void Page_Load(object sender, EventArgs e)
        {

        }

        protected void btnSummit_Click(object sender, EventArgs e)
        {
            string strUserNmae = this.username.Value.Trim();
            //  string strPassWord = this.password.Value; //用户密码
            HttpContext.Current.Session["USERNAME"] = this.username.Value.Trim();
            HttpContext.Current.Session["USERWORD"] = this.password.Value.Trim();
            HttpContext.Current.Session["pcoripad"] = dropType.SelectedValue;
            string strPassWord = FormsAuthentication.HashPasswordForStoringInConfigFile(this.password.Value.Trim(), "MD5").Substring(0, 18);
            try
            {
                if (!Universal.UserLogin.ProcessLogin(strUserNmae, strPassWord))
                {
                    Universal.JS.Alert("用户名或密码错误！");
                }
            }
            catch (Exception)
            {

                Universal.JS.Alert("数据库链接错误！");
            }
        }
    }
}